<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/function.js"></script>
</head>
<body>
    <a href="javascript:;" onclick="f();">test1</a>
</body>
</html>